package cn.momoky.ccool.controller;

import cn.momoky.ccool.pojo.view.LoginRequest;
import cn.momoky.ccool.pojo.view.LoginResponse;
import cn.momoky.ccool.service.UserService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/user")
@AllArgsConstructor
public class UserController {

    private final UserService userService;

    @PostMapping("/login")
    public LoginResponse userLogin(@RequestBody LoginRequest loginRequest, HttpServletRequest request){
        return userService.login(loginRequest);
    }

}
